/**
 * Miner场景内的光源管理
 */
runOnStartup(async runtime => {
    cc_Game.addEventListener("minerTick", (e) => {
    })
    cc_Game.addEventListener("minerInit", (e) => {
        LightGeneratedManager.OnLightGeneratedInStart()
    })
});
cc_Game.LightGeneratedManager = {
    OnLightGeneratedInStart: function () {
        var VerNier = MinerVernierSpwn.setVernier
        if (VerNier == null) return
        /**
         * 光源属性
         * @type {number}
         */
        var LIGHT_COUNT = 5        // 光源数量
        var LIGHT_SPWN_TYPE = 1    // 光源分布类型
        var LIGHT_ENBLE = true     // 是否启动光源
        var LIGHR_SCLAE = 1        // 光源大小
        var LIGHT_EFFECT = 1       // 光源强度

        if (!LIGHT_ENBLE) return;
        for (let i = 0; i < LIGHT_COUNT; i++) {
            var lightClass = runtime.objects.Light
            var spPosX = VerNier.x + cc_GamewithMath.RandomNum(-900, 900)
            var spPosY = VerNier.y + 500 * i
            const LightSource = lightClass.createInstance("l2", spPosX, spPosY, true)
            LightSource.opacity = LIGHT_EFFECT
            LightSource.width *= LIGHR_SCLAE
            LightSource.height *= LIGHR_SCLAE

        }
    }

}

export default LightGeneratedManager